package com.yuheadline.article.config;

import com.yuheadline.article.interceptor.ArticleInterceptor;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.lang.NonNull;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
 * MVC配置
 *
 * @author 高翔宇
 * @since 2024/4/30 周二 下午10:16
 */
@SpringBootConfiguration
public class MvcConfig implements WebMvcConfigurer {
    /**
     * 添加拦截器
     */
    @Override
    public void addInterceptors(@NonNull InterceptorRegistry registry) {
        registry.addInterceptor(new ArticleInterceptor()).addPathPatterns("/**");
    }
}
